package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type Appconfig struct {
	Mysql
	Redis
	Auth
}
type Mysql struct {
	Username string
	Password string
	Host     string
	Port     int
	Database string
}
type Redis struct {
	Password string
	Host     string
	Port     int
}
type Auth struct {
	SecretId  string
	SecretKey string
}

var Config Appconfig

func GetConfigData() {
	viper.SetConfigFile("appconfig/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&Config)
	log.Println(Config)
}
